$def with (list, editions, works, authors)
<html>
<head>
    <title>$_('%(list)s - Editions', list=list.name)</title>
    <style type="text/css">
        h3.title {
            display: inline;
        }
    </style>
</head>
<body>
    $def render_authors(book):
        <span class="author">
            $if book.works:
                $ authors = book.works[0].get_authors()
            $else:
                $ authors = book.get_authors()

            $if authors:
                $for a in authors:
                    <a href="$request.home$a.url()">$a.name</a>$cond(not loop.last, ", ")
            $else:
                <em>$_("Unknown authors")</em>
        </span>
    <ul>
    $for book in editions:
        <li>
            <h3 class="title">
                <a href="$request.home$book.url()">$book.get('title', 'Title unknown')</a>
            </h3>
            by $:render_authors(book)
            <div class="published">
                $if book.publishers and book.publish_date:
                    $book.publish_date, $(', '.join(book.publishers))
                $elif book.first_publish_date:
                    $book.publish_date
                $elif book.publishers:
                    <em>$_("Publish date unknown")</em>, $(', '.join(book.publishers))
                $else:
                    <em>$_("Publisher unknown")</em>
            </div>
            <br/>
        </li>
    </ul>
    <ul>
    $for book in works:
        <li>
            <h3 class="title">
                <a href="$request.home$book.url()">$book.get('title', _('Title unknown'))</a>
            </h3>
            by $:render_authors(book)

            <div class="published">
                $if book.first_publish_year:
                    $book.first_publish_year
                $else:
                    <em>$_("First publish date unknown")</em>
            </div>
            <br/>
        </li>
    </ul>
    <ul>
    $for author in authors:
        <li>
            <h3 class="title">
                <a href="$request.home$author.url()">$author.get('name', _('Name unknown'))</a>
            </h3>
            $if author.birth_date:
                ( $author.birth_date
            $else:
                <em>( - </em>
            $if author.death_date:
                - $author.death_date )
            $else:
                <em> )</em>
            <br/>
        </li>
    </ul>
</body>
</html>
